<?php
/**
 * Created by PhpStorm.
 * User: ai
 * Date: 2017/10/17
 * Time: 16:59
 */

use kartik\grid\GridView;
use yii\helpers\Html;

?>

<?php if ($historyDataProvider->count > 0): ?>
    <div class="row">
        <div class="col-sm-8 col-sm-offset-2">
            <?php

            echo GridView::widget([
                'dataProvider' => $historyDataProvider,
//                'filterModel' => $historySearchModel,
                'layout' => "{items}\n{summary}",
                'columns' => [
                    'history_date',
                    'history_contact',
                    'history_result',
                    [
                        'class' => '\kartik\grid\ActionColumn',
                        'viewOptions' => ['label' => false],
                        'updateOptions' => [],
                        'deleteOptions' => [],
                        'buttons' => [
                            'update' => function ($url, $model) {
                                return Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['customer-commu-history/update', 'id' => $model->id]);
                            },
                            'delete' => function ($url, $model) {
                                return Html::a('<span class="glyphicon glyphicon-trash"></span>', ['customer-commu-history/delete', 'id' => $model->id], ['class' => 'w1-action-del', 'title' => '删除', 'data-method' => 'post', 'data-pjax' => 0, 'data-confirm' => '确定要删除吗？',]);
                            }
                        ]
                    ],
                ],
                'containerOptions' => ['style' => 'overflow: auto'], // only set when $responsive = false
                'headerRowOptions' => ['class' => 'kartik-sheet-style'],
                'filterRowOptions' => ['class' => 'kartik-sheet-style'],
                'bordered' => true,
                'striped' => true,
                'condensed' => true,
                'responsive' => true,
                'hover' => true,
//                    'showPageSummary' => true,
                'panel' => [
//                    'type' => GridView::TYPE_PRIMARY,
//                    'heading' => '沟通记录',
                ],
                'persistResize' => false,
            ]);
            ?>
        </div>
    </div>
<?php endif; ?>
